<template>
  <div>
    <van-swipe class="my-swipe" :autoplay="3000" indicator-color="white">
      <van-swipe-item v-for="item in swipeArr" :key="item.id">
        <img :src="$pre+item.img" alt />
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
import { reqSwipde } from "../http/api";
export default {
  data() {
    return {
      swipeArr: [],
    };
  },
  mounted() {
    reqSwipde().then((res) => {
      if (res.data.code == 200) {
        // console.log(res);
        this.swipeArr = res.data.list;
      }
    });
  },
};
</script>

<style scoped>
.my-swipe{
    width: 100%;
    height: 4rem;
}
img{
    width: 100%;
    height: 100%;
}
</style>